import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;

public class Avg {
    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder();

        try (InputStream inputStream = Files.newInputStream(Paths.get("./data01.txt"));
             Scanner scanner = new Scanner(inputStream)) {
            while (scanner.hasNext()) {
                stringBuilder.append(scanner.next()).append("\n");
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

//        System.out.println(stringBuilder);

        Map<String, List<Integer>> result = new HashMap<>();
        String[] lines = stringBuilder.toString().split("\n");


        for (String line : lines) {
            String[] parts = line.split(",");
            String key = parts[1];
            int score = Integer.parseInt(parts[2]);

            if (!result.containsKey(key)) {
                result.put(key, new ArrayList<>());
            }
            result.get(key).add(score);
        }
    }

}
